# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------

"""Factory method for easily getting imdbs by name."""

__sets = {}

from datasets.pascal_voc import pascal_voc

def get_imdb(name, devkit_path, fold_name):
    """Get an imdb (image database) by name."""
    # if not __sets.has_key(name):
    #     raise KeyError('Unknown dataset: {}'.format(name))
    __sets['voc_2007_trainval'] = (lambda split='trainval', year='2007': pascal_voc(split, year, devkit_path, fold_name))
    return __sets[name]()

def list_imdbs():
    """List all registered imdbs."""
    return __sets.keys()
